define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'img.banner/index',
        add_url: 'img.banner/add',
        edit_url: 'img.banner/edit',
        delete_url: 'img.banner/delete',
        export_url: 'img.banner/export',
        modify_url: 'img.banner/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh','add'],
                cols: [[
                    {field: 'type', minWidth: 80, title: '类型',selectList: {1: '顶部轮播图',2: '中部轮播图',3: '一级分类图',4: '分销海报图'}},
                    {field: 'img', minWidth: 80, title: '图片', search: false, templet: ea.table.image}, 
                    {field: 'imgurl', title: '链接',search: false},
                    {field: 'add_time', title: '添加时间',search: false},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});